折腾:【未解决】Win中VMWare中macOS初始化开发环境期间,继续去安装Python 3然后去找找之前自己的mac中安装python 3的帖子参考【已解决】Mac中安装Python【已解决】Mac中安装最新版的Python3去试试先安装brew:【已解决】Win中VMWare中macOS虚拟机中安装homebrew再去用brew安装pyenvbrew install pyenvlogcrifanlideMac:homebrew crifanli$ brew install pyenv
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/autoconf-2.69.mojave.bottle.4.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/openssl%401.1-1.1.1g.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/pkg-config-0.29.2_3.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/readline-8.0.4.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/pyenv-1.2.19.mojave.bottle.tar.gz
######################################################################## 100.0%
==> Installing dependencies for pyenv: autoconf, [email protected], pkg-config and readline
==> Installing pyenv dependency: autoconf
==> Pouring autoconf-2.69.mojave.bottle.4.tar.gz
==> Caveats
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/autoconf
==> Summary
�� /usr/local/Cellar/autoconf/2.69: 71 files, 3.0MB
==> Installing pyenv dependency: [email protected]
==> Pouring [email protected]
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/[email protected]/certs
and run
/usr/local/opt/[email protected]/bin/c_rehash
[email protected] is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have [email protected] first in your PATH run:
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> /Users/crifanli/.bash_profile
For compilers to find [email protected] you may need to set:
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
==> Summary
�� /usr/local/Cellar/[email protected]/1.1.1g: 8,059 files, 18MB
==> Installing pyenv dependency: pkg-config
==> Pouring pkg-config-0.29.2_3.mojave.bottle.tar.gz
�� /usr/local/Cellar/pkg-config/0.29.2_3: 11 files, 623.6KB
==> Installing pyenv dependency: readline
==> Pouring readline-8.0.4.mojave.bottle.tar.gz
==> Caveats
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
For pkg-config to find readline you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"
==> Summary
�� /usr/local/Cellar/readline/8.0.4: 48 files, 1.5MB
==> Installing pyenv
==> Pouring pyenv-1.2.19.mojave.bottle.tar.gz
�� /usr/local/Cellar/pyenv/1.2.19: 704 files, 2.5MB
==> Caveats
==> autoconf
Emacs Lisp files have been installed to:
/usr/local/share/emacs/site-lisp/autoconf
==> [email protected]
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/[email protected]/certs
and run
/usr/local/opt/[email protected]/bin/c_rehash
[email protected] is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.
If you need to have [email protected] first in your PATH run:
echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> /Users/crifanli/.bash_profile
For compilers to find [email protected] you may need to set:
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
For pkg-config to find [email protected] you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"
==> readline
readline is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BSD libedit.
For compilers to find readline you may need to set:
export LDFLAGS="-L/usr/local/opt/readline/lib"
export CPPFLAGS="-I/usr/local/opt/readline/include"
For pkg-config to find readline you may need to set:
export PKG_CONFIG_PATH="/usr/local/opt/readline/lib/pkgconfig"以及:以为是pyenv versions看看当前有哪些python 3的版本,比如3.8.0实际是pyenv,让你轻松切换各种python版本 – 简书pyenv install --listlog$ pyenv install --list
Available versions:
2.1.3
2.2.3
2.3.7
2.4.0
2.4.1
2.4.2
2.4.3
2.4.4
2.4.5
2.4.6
2.5.0
2.5.1
2.5.2
2.5.3
2.5.4
2.5.5
2.5.6
2.6.6
2.6.7
2.6.8
2.6.9
2.7.0
2.7-dev
2.7.1
2.7.2
2.7.3
2.7.4
2.7.5
2.7.6
2.7.7
2.7.8
2.7.9
2.7.10
2.7.11
2.7.12
2.7.13
2.7.14
2.7.15
2.7.16
2.7.17
2.7.18
3.0.1
3.1.0
3.1.1
3.1.2
3.1.3
3.1.4
3.1.5
3.2.0
3.2.1
3.2.2
3.2.3
3.2.4
3.2.5
3.2.6
3.3.0
3.3.1
3.3.2
3.3.3
3.3.4
3.3.5
3.3.6
3.3.7
3.4.0
3.4-dev
3.4.1
3.4.2
3.4.3
3.4.4
3.4.5
3.4.6
3.4.7
3.4.8
3.4.9
3.4.10
3.5.0
3.5-dev
3.5.1
3.5.2
3.5.3
3.5.4
3.5.5
3.5.6
3.5.7
3.5.8
3.5.9
3.6.0
3.6-dev
3.6.1
3.6.2
3.6.3
3.6.4
3.6.5
3.6.6
3.6.7
3.6.8
3.6.9
3.6.10
3.7.0
3.7-dev
3.7.1
3.7.2
3.7.3
3.7.4
3.7.5
3.7.6
3.7.7
3.8.0
3.8-dev
3.8.1
3.8.2
3.8.3
3.9.0b3
3.9-dev
3.10-dev
。。。最新稳定版是:3.8.3再去用pyenv安装最新版python 3.8.3pyenv install 3.8.3logcrifanlideMac:homebrew crifanli$ pyenv install 3.8.3
python-build: use [email protected] from homebrew
python-build: use readline from homebrew
Downloading Python-3.8.3.tar.xz...
-> https://www.python.org/ftp/python/3.8.3/Python-3.8.3.tar.xz
Installing Python-3.8.3...
python-build: use readline from homebrew
python-build: use zlib from xcode sdk然后等待很长时间过了会,就好了:Installed Python-3.8.3 to /Users/crifanli/.pyenv/versions/3.8.3再去设置全局版本是3.8.3pyenv global 3.8.3logcrifanlideMac:homebrew crifanli$ pyenv version
system (set by /Users/crifanli/.pyenv/version)
crifanlideMac:homebrew crifanli$ pyenv versions
* system (set by /Users/crifanli/.pyenv/version)
3.8.3
crifanlideMac:homebrew crifanli$ python --version
Python 2.7.10
crifanlideMac:homebrew crifanli$ which python
/usr/bin/python
crifanlideMac:homebrew crifanli$ pyenv global 3.8.3再去更新到启动脚本中echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profilelogcrifanlideMac:homebrew crifanli$ echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile
crifanlideMac:homebrew crifanli$ cat ~/.bash_
.bash_history .bash_profile .bash_sessions/
crifanlideMac:homebrew crifanli$ cat ~/.bash_profile
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
if command -v pyenv 1>/dev/null 2>&1; then
eval "$(pyenv init -)"
fi然后重新启动一个terminal终端,看看版本是否有变化Last login: Fri Jun 19 02:14:28 on ttys002
crifanlideMac:homebrew crifanli$ which python
/Users/crifanli/.pyenv/shims/python
crifanlideMac:homebrew crifanli$ python --version
Python 3.8.3
crifanlideMac:homebrew crifanli$版本的确变成了我们要的最新的3.8.3了至此,就算安装完毕了。后记:再去看看pip版本crifanlideMac:homebrew crifanli$ pip3 --version
pip 19.2.3 from /Users/crifanli/.pyenv/versions/3.8.3/lib/python3.8/site-packages/pip (python 3.8)【总结】Win中VMWare的macOS中安装最新版Python:(1)macOS中安装homebrew正常情况下,直接用homebrew官网的一句命令:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"即可。但是此处遇到一些问题,所以建议用:【已解决】Win中VMWare中macOS虚拟机中安装homebrew总结的步骤去安装。(2)用brew安装,用来管理多个Python版本的工具:pyenvbrew install pyenv(3)用pyenv安装最新版的(比如3.8.3)的python 3pyenv install 3.8.3其中,最新的稳定版的Python 3,可以通过:pyenv install --list查看到具体的版本号。(4)收尾:设置python 3为全局版本 + 加到启动脚本中最后再去:把Python 3设置为全局版本pyenv global 3.8.3然后再去把pyenv的设置全局版本的动作,加到macOS启动脚本中echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.bash_profile注:根据你的情况,把~/.bash_profile换成你的启动脚本,比如~/.bashrc、~/.zshrc等,即可。 转载请注明:在路上 » 【已解决】Win的VMWare的macOS中安装Python3
|